<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>添加科研项目</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
</head>
<body>
<div class="container mt-4">
    <h1 class="text-center mb-4">添加科研项目</h1>
    
    <div class="row justify-content-center">
        <div class="col-md-8">
            <form th:action="@{/researches/add}" method="post">
                <div class="form-group">
                    <label for="title">项目名称</label>
                    <input type="text" class="form-control" id="title" name="title" required>
                </div>
                
                <div class="form-group">
                    <label for="content">项目描述</label>
                    <textarea class="form-control" id="content" name="content" rows="3"></textarea>
                </div>
                
                <div class="form-group">
                    <label for="researchTypeId">科研类型</label>
                    <select class="form-control" id="researchTypeId" name="researchType.typeId" required>
                        <option value="">请选择科研类型</option>
                        <option th:each="type : ${researchTypes}" 
                                th:value="${type.typeId}" 
                                th:text="${type.typeName}">
                        </option>
                    </select>
                </div>
                
                <div class="form-group">
                    <label for="teacherId">负责教师</label>
                    <select class="form-control" id="teacherId" name="teacher.teacherId" required>
                        <option value="">请选择负责教师</option>
                        <option th:each="teacher : ${teachers}" 
                                th:value="${teacher.teacherId}" 
                                th:text="${teacher.name}">
                        </option>
                    </select>
                </div>
                
                <div class="form-group">
                    <label for="publishDate">发布日期</label>
                    <input type="date" class="form-control" id="publishDate" name="publishDate" required>
                </div>
                
                <div class="form-group">
                    <label for="status">项目状态</label>
                    <select class="form-control" id="status" name="status" required>
                        <option value="PLANNING">计划中</option>
                        <option value="IN_PROGRESS">进行中</option>
                        <option value="COMPLETED">已完成</option>
                        <option value="SUSPENDED">已暂停</option>
                    </select>
                </div>
                
                <div class="text-center">
                    <button type="submit" class="btn btn-primary">提交</button>
                    <a href="/researches" class="btn btn-secondary ml-2">返回</a>
                </div>
            </form>
        </div>
    </div>
</div>

<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html> 